home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / private / _getfont.c < prev    next >
C/C++ Source or Header  |  1993-06-20  |  2KB  |  98 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3.  
  4. #ifdef PDCDEBUG
  5. char *rcsid__getfont = "$Header: C:\CURSES\private\RCS\_getfont.c 2.1 1993/06/18 20:22:30 MH Rel MH $";
  6. #endif
  7.  
  8.  
  9.  
  10.  
  11. /*man-start*********************************************************************
  12.  
  13.   PDC_get_font()    - Get the current font size
  14.  
  15.   PDCurses Description:
  16.      This is a private PDCurses routine.
  17.  
  18.      This function returns the current font size.  This function only
  19.      works if the #define FAST_VIDEO is true.
  20.  
  21.   PDCurses Return Value:
  22.      This function returns OK on success and ERR on error.
  23.  
  24.   PDCurses Errors:
  25.      An ERR will be returned if FAST_VIDEO is not true.
  26.  
  27.   Portability:
  28.      PDCurses    int PDC_get_font( void );
  29.  
  30. **man-end**********************************************************************/
  31.  
  32. int    PDC_get_font(void)
  33. {
  34. #if    defined (DOS) && defined (FAST_VIDEO)
  35.     int    retval;
  36. #endif
  37.  
  38. #ifdef OS2
  39.     VIOMODEINFO modeInfo;
  40. #endif
  41.  
  42. #ifdef PDCDEBUG
  43.     if (trace_on) PDC_debug("PDC_get_font() - called\n");
  44. #endif
  45.  
  46. #if    defined (DOS) && defined (FAST_VIDEO)
  47.     retval = getdosmemword (0x485);
  48.     if ((retval == 0) && (_cursvar.adapter == _MDS_GENIUS))
  49.     {
  50.         retval = _FONT15; /* Assume the MDS Genius is in 66 line mode. */
  51.     }
  52.     switch (_cursvar.adapter)
  53.     {
  54.     case _MDA:
  55.             retval = 10; /* POINTS is not certain on MDA/Hercules */
  56.             break;
  57.     case _EGACOLOR:
  58.     case _EGAMONO:
  59.         switch (retval)
  60.         {
  61.         case _FONT8:
  62.         case _FONT14:
  63.             break;
  64.         default:
  65.             retval = _FONT14;
  66.         }
  67.         break;
  68.  
  69.     case _VGACOLOR:
  70.     case _VGAMONO:
  71.         switch (retval)
  72.         {
  73.         case _FONT8:
  74.         case _FONT14:
  75.         case _FONT16:
  76.             break;
  77.         default:
  78.             break;
  79.         }
  80.         break;
  81.     default:
  82.         break;
  83.     }
  84.     return( retval );
  85. #endif
  86.  
  87. #ifdef OS2
  88.     modeInfo.cb = sizeof(modeInfo);
  89.         /* set most parameters of modeInfo */
  90.     VioGetMode(&modeInfo, 0);
  91.         return ( modeInfo.vres / modeInfo.row);
  92. #endif
  93.  
  94. #ifdef UNIX
  95.     return(0); /* this is N/A */
  96. #endif
  97. }
  98.